Skip to content

Feature A: Start new task branches at their published head - #1097

Merged
oxa-orchestrator[bot] merged 17 commits into
mainfrom
oxa/issue-1052
Nov 18, 2026
Merged

oxa-orchestrator[bot] merged 17 commits into
mainfrom
oxa/issue-1052

Conversation

@oxa-agent

@oxa-agent oxa-agent Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Feature A (#1214), T3. Fixes #1052. Ports #307's worktree lifecycle and post-commit publish row: a fresh task starts at its unambiguous published task head, preserving earlier work.

Published-head selection reads Git metadata only. It collects every matching remote tip before deduplication and ancestry validation. A sole eligible head becomes the detached worktree's start commit; the existing checkout supervisor creates the task branch without replacing a concurrent writer's branch. Adopted materialization uses the restricted execution policy. Local save and merge preserve sandboxed callbacks, refusal and work retention.

Current candidate 206fa3e404850a6282b00cf4ef3807007c7dac44 is Ready after the repair passed its selected lane. Automatic acceptance now applies the existing user network/offline policy without GitHub authentication lookup or injection. The policy implementation is shared with the existing front-end guard; no new setting, store or authority. Adopted checkout restrictions and the landed #1043 normalization/holder/original-OID safeguards remain. Main's publication/save-recovery, diagnostic scrub, reviewed-head, checkpoint and lock/handover guards are preserved.

Validation:

  • Latest tests-only 4c11c23d: before lane 44211784225 failed at runtime. ARM ran 4,804 tests: 4,803 passed, one intended new assertion failed after successful task completion and positive acceptance execution; three existing opt-in tests were skipped. The synthetic real-binary regression also covers online/offline policy and verifies that host authentication is not consulted. No real credentials or external services.
  • Current 206fa3e4: lane 44213792874 SUCCESS, oxa and oxc-rs on x86_64/ARM64, including the online/offline regression. Ready full required CI 44215750284 SUCCESS; every required check is pass/expected skip. The owner freshly read and approved this exact repaired scope.
  • Current-head Code review clear and security review clear. The three verified historical findings are addressed and resolved. Merged at 2026-11-18T02:05:07Z as 435013b2085b7ea9ad69a0633aa328cab96642b5; queue integration 44219420023 passed on that exact landed commit. No earlier approval or CI result was substituted.
  • Earlier e9af6cca passed lane 44207390279 and Ready full required 44207311487 with Code review clear. Its security review identified the additional scope now being repaired. The earlier 18bc55c7 passed lane 44204858138 on all 28 oxa crates plus oxc-rs on x86_64 and ARM64. These are provenance only.
  • Retains the published-head, divergent-tip, ordinary callback, adopted materialization, local save/merge and combined adoption/normalization controls. Earlier before-fix callback evidence is in lane 44202990800. Initial 09f29dbb hit an existing guard and is fixture feedback, not product failure proof.
  • Configured rustfmt and git diff --check pass; no local builds/tests. Every existing test/assertion and the full branch history are retained.

Existing branch oxa/issue-1052; normal main merges resolved actual conflicts. No history rewrite, helper activation or lab script changes. Core #1254 and its consumer ownership remain separate.

A task for an already pushed branch (for example a pull request's head)
started a fresh worktree at the captured base, because the local branch did
not exist. The worker then audited and continued a tree that predates the
published commits and redid work that was already on the head.

Before creating the worktree, a task branch that has no local ref is created
at the lone remote-tracking tip of the same name when that tip descends from
the captured base and carries commits the base lacks. No fetch runs, the
update is a compare-and-swap that can only create the ref, and several
diverging tips, an unrelated tip or a tip equal to the base keep the base.
An existing local branch, including a retained or unfinished one, is untouched.

Tests: work_continue starts from a deleted local branch with a fetched
origin/agent/test and asserts the worker's tree and the branch both sit at
the pushed commit.

Fixes #1052
@oxa-orchestrator
oxa-orchestrator Bot marked this pull request as ready for review November 17, 2026 17:08
@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

First-pass review by oxa → oxc → chatgpt/gpt-6.1-sol at head d0c9ed9 (O-241; the orchestrator adjudicates and enqueues).

  • P2 — oxa/oxa-work/src/tree.rs:169: Published branches always fail fresh checkout. When a matching published tip exists, adopt_published_head creates refs/heads/<task.branch>, but create remains true. Preparation therefore creates a detached worktree at the base and passes create: true to the supervisor, which runs git checkout -b '<branch>' HEAD (oxa/oxa-cli/src/work_checks.rs:34). Git refuses because that branch now exists, so oxa work fails instead of continuing the published head. The new fresh_worktree_starts_at_the_published_task_branch_head test exercises this failure.

TIER: T2
VERDICT: REVISE

🤖 Generated with Claude Code (oxa review lane)

Adopting the published head created refs/heads/<task> before the worktree
existed, but the sandboxed checkout still ran `git checkout -b <task> HEAD`
for a task without a local branch and failed with "a branch named '<task>'
already exists", blocking every task whose branch had just been adopted.

The adoption now reports whether it created the ref. When it did, the
worktree attaches to that branch and the sandboxed checkout only materialises
its tree; otherwise the previous detached worktree at the base and the
sandbox-side branch creation are unchanged.

Tests: work_continue asserts the task branch, HEAD and the worker's tree all
sit at the pushed commit.
@oxa-agent
oxa-agent Bot marked this pull request as draft November 17, 2026 17:23
…heckout

The published-head test asserted `symbolic-ref HEAD` in the source checkout,
which `oxa work` deliberately never moves: it stays on the captured base while
the task branch is created for the worktree. The assertion therefore checked
the wrong repository and failed. It now asserts the task worktree's HEAD and
that the source checkout is still on the base.

Adoption also read the base with a strict `rev-parse`, so a base that does not
resolve failed the run before the ordinary path could report it; it is now
skipped and left to that path. The zero old value for the compare-and-swap
follows the repository's hash algorithm instead of assuming SHA-1, and a ref
that appears between the check and the update no longer fails the run: the
caller attaches the existing branch, as it does for any existing branch.

Tests: the published-head test now asserts both HEADs; a second test pushes an
orphan branch under the task name and asserts the worktree and the local branch
both stay at the base without its file.
@oxa-orchestrator
oxa-orchestrator Bot marked this pull request as ready for review November 17, 2026 17:29
@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

First-pass review by oxa → oxc → chatgpt/gpt-6.1-sol at head 584c041 (O-241; the orchestrator adjudicates and enqueues).

  • P1 — oxa/oxa-work/src/tree.rs:146: Unsandboxed reference-transaction hook execution. The new host-side git update-ref invokes an installed reference-transaction hook. metadata_git does not disable hooks, unlike the existing worktree-add command. Starting a task with an eligible published head can therefore execute repository-configured code outside the sandbox, with access to host credentials and private files. Disable hooks for this metadata mutation.
  • P2 — oxa/oxa-work/src/tree.rs:118–133: Ambiguous published heads can be adopted. If origin/agent/test descends from the base but other/agent/test has diverged from it, the latter is discarded before ambiguity checking. The remaining tip is adopted despite the documented guarantee to keep the base for several diverging tips. Collect and deduplicate all matching tips before checking the sole candidate’s ancestry.
    TIER: T3
    VERDICT: REVISE

🤖 Generated with Claude Code (oxa review lane)

@oxa-agent oxa-agent Bot changed the title WIP: work: start a new task branch at its published head Feature A: Start new task branches at their published head Nov 17, 2026
@oxa-agent
oxa-agent Bot marked this pull request as ready for review November 17, 2026 22:18
@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@n0rpan

n0rpan commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T01:52:50.881393Z 206fa3e Manual request
🔒 Security Review ✅ Completed 2026-11-18T01:55:46.961251Z 206fa3e Manual request

Security findings

Advisory findings (3)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: ca01b0031a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@oxa-orchestrator
oxa-orchestrator Bot enabled auto-merge November 17, 2026 22:24
@oxa-orchestrator

Copy link
Copy Markdown

st merge-flow>author #1097ca01b00 queue=REJECTED run=? next=refresh-on-main note="Composition with current main failed; rebase/merge main, fix, push; a new head needs a new verdict."

see run log

@oxa-orchestrator
oxa-orchestrator Bot added this pull request to the merge queue Nov 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: ca01b0031a

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread oxa/oxa-work/src/tree.rs Resolved
@oxa-agent
oxa-agent Bot marked this pull request as draft November 17, 2026 22:33
@oxa-agent
oxa-agent Bot removed this pull request from the merge queue due to a manual request Nov 17, 2026
@oxa-agent
oxa-agent Bot marked this pull request as ready for review November 17, 2026 23:12
@oxa-agent
oxa-agent Bot marked this pull request as ready for review November 18, 2026 00:16
# Conflicts:
#	oxa/oxa-cli/tests/common/work.rs
@n0rpan

n0rpan commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@n0rpan

n0rpan commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: e9af6ccad1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@oxa-orchestrator
oxa-orchestrator Bot added this pull request to the merge queue Nov 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: e9af6ccad1

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread oxa/oxa-work/src/tree.rs Resolved
@oxa-agent
oxa-agent Bot marked this pull request as draft November 18, 2026 00:44
@oxa-agent
oxa-agent Bot removed this pull request from the merge queue due to a manual request Nov 18, 2026
@oxa-agent
oxa-agent Bot marked this pull request as ready for review November 18, 2026 01:25
@n0rpan

n0rpan commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@n0rpan

n0rpan commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

@codex security review

@n0rpan

n0rpan commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@n0rpan

n0rpan commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

@codex security review

@oxa-orchestrator
oxa-orchestrator Bot added this pull request to the merge queue Nov 18, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 206fa3e404

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 206fa3e404

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Merged via the queue into main with commit 435013b Nov 18, 2026
53 checks passed
@oxa-orchestrator
oxa-orchestrator Bot deleted the oxa/issue-1052 branch November 18, 2026 02:05
@oxa-agent

oxa-agent Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Merged as 435013b at 2026-11-18T02:05:07Z. Merge-group integration 44219420023 passed on that exact landed commit.

Source 206fa3e passed selected x86/ARM lane 44213792874 and full required CI 44215750284, with the fresh owner read and current-head Code/security reviews clear. All three historical findings are addressed and resolved; dedicated before/after controls are retained. No earlier-head approval or CI result was substituted.

Both lifecycle fixes (#1043 and #1097) and the Core binding slices (#1220 and #1254) have now landed. The complete native board/caller/completion acceptance remains a separate, assigned integration task; these merges do not claim the whole #307 row complete. Helpers remain paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dogfood: Worktree started at the PR base instead of the PR head

1 participant